{% extends 'iframe/basePlus.html.twig' %}
{% block cardHeader %}
    编辑<a href="/Admin/ModelField/index" class="layui-btn layui-btn-sm" style="float:right;margin-top:6px;">列表</a>
{% endblock %}
{% block cardBody %}
    <style>
        .layui-form-label {
            width: 140px;
        }
        .layui-input-block {
            margin-left: 170px;
        }
    </style>
    <form class="layui-form">
        <dry-common role="input" label="排序" name="dry_sort" value="{{ rs.dry_sort }}" placeholder="请输入排序"></dry-common>
        <dry-common role="input" label="字段列表排序" name="dry_field_list_sort" value="{{ rs.dry_field_list_sort }}" placeholder="请输入排序"></dry-common>
        <dry-common role="input" label="字段搜索排序" name="dry_field_search_sort" value="{{ rs.dry_field_search_sort }}" placeholder="请输入排序"></dry-common>
        <dry-common role="input" label="字段搜索默认值" name="dry_field_search_default" value="{{ rs.dry_field_search_default }}" placeholder="字段搜索默认值"></dry-common>
        <dry-common role="radio" label="添加|编辑时显示" name="dry_add_edit_is_show" value="{{ rs.dry_add_edit_is_show }}" url="/Api/Choice/getListByKey?key=yesNo"></dry-common>
        <dry-common role="radio" label="是否初始隐藏列" name="dry_is_init_hide" value="{{ rs.dry_is_init_hide }}" url="/Api/Choice/getListByKey?key=yesNo"></dry-common>
        <dry-common role="radio" label="列表即时编辑" name="dry_is_list_edit" value="{{ rs.dry_is_list_edit }}" url="/Api/Choice/getListByKey?key=yesNo"></dry-common>
        <dry-common role="radio" label="列表点击排序" name="dry_is_list_click_sort" value="{{ rs.dry_is_list_click_sort }}" url="/Api/Choice/getListByKey?key=yesNo"></dry-common>
        <dry-common role="radio" label="搜索" name="dry_is_search" value="{{ rs.dry_is_search }}" url="/Api/Choice/getListByKey?key=yesNo"></dry-common>
        <dry-common role="radio" label="加密字段" name="dry_is_encrypt" value="{{ rs.dry_is_encrypt }}" url="/Api/Choice/getListByKey?key=yesNo"></dry-common>
        <dry-common role="select" label="搜索默认SQL操作符" name="dry_sql_operate" value="{{ rs.dry_sql_operate }}" url="/Api/DataPool/getData?name=sqlOperate"></dry-common>
        <dry-common role="select" label="字段模板" name="dry_field_template" value="{{ rs.dry_field_template }}" url="/Api/Choice/getListByKey?key=fieldTemplate"></dry-common>
        <dry-common role="select" label="字段宽度" name="dry_field_width" value="{{ rs.dry_field_width }}" url="/Api/Choice/getListByKey?key=fieldWidth"></dry-common>
        <dry-common role="select" label="默认数据源首选项" name="dry_first_choice" value="{{ rs.dry_first_choice }}" url="/Api/DataPool/getData?name=firstChoice"></dry-common>
        <dry-common role="select" label="搜索时数据源首选项" name="dry_search_first_choice" value="{{ rs.dry_search_first_choice }}" url="/Api/DataPool/getData?name=firstChoice"></dry-common>
        <dry-common role="submit" submit="确定" reset="重置"></dry-common>
    </form>
    <script>
        layui.use(["dry"], function(dry){
            function getVerify()
            {
                var result = {
                    dry_name:function(value){if(value == ""){return "请输入名称";}}
                };
                return result;
            }

            dry.submit(getVerify(), "/Admin/ModelField/index", "/Api/ModelField/edit?id={{ rs.id }}");
        });
    </script>
{% endblock %}